<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

/**
 * Class PriceCategory
 * @package App\Models
 */
class PriceCategory extends Model
{
    protected $fillable = [
        'name',
        'status',
        'description',
        'school_id'
    ];

    /**
     * @param $query
     * @param $name
     */
    public function scopeNameLike($query, $name)
    {
        $query->when($name, function ($query) use ($name) {
            $query->where('name', 'like', $name . '%');
        });
    }
}